<template>
  <div class="help-card">
    <el-card
      shadow="always"
      :body-style="{
        padding: '20px 20px 0px 20px',
        position: 'relative',
        height: '194px',
      }"
    >
      <div slot="header">
        <p class="title">{{ help.title }}</p>
        <div class="header-bottom">
          <div class="category">{{help.categoryName}}</div>
          <div class="user">
            <i class="el-icon-user"></i>
            {{help.pubNickName?help.pubNickName:help.pubName}}
          </div>
        </div>
      </div>
      <!-- card body -->
      <router-link :to="`/helpDetail?helpId=${help.id}`">
        <div class="info">
          <div class="location">
            <p class="label1">
              <i class="el-icon-location-information"></i>
              地点
            </p>
            <p class="content" >{{help.location}}</p>
          </div>
          <div class="reward">
            <span class="label2">
              <i class="el-icon-wallet"></i>
              报酬</span
            >
            <span style=" color:#606266;font-size:14px">{{help.reward}}￥</span>
          </div>
          <div class="need-num">
            <i class="iconfont icon-icon-person-hezuo2"></i>
            <span class="label2"> 需求数</span>
            <span style="font-size:14px;color:#606266">{{help.needNum}}</span>
            <span style="margin: 0px 5px; color: lightgray; font-weight: bold"
              >/</span
            >
            <span class="label2"> 已协助</span>
            <span style="font-size:14px;color:#606266">{{help.assistNum}}</span>
          </div>
        </div>
        <div class="bottom">
          <div class="create-time">
            <i class="el-icon-time"></i>
            {{help.createTime}}
          </div>
          <div class="view-count">
            <i class="el-icon-view"></i>
            {{help.viewCount}}
          </div>
        </div>
      </router-link>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "VueTaoHelpcard",
  data() {
    return {};
  },
  props: {
    help: {
      type: Object,
      default: () => ({
        id: "1",
        title: "测试标题",
        categoryName: "外卖代取",
        assistNum: 0,
        needNum: 1,
        location: "测试地点",
        createTime: "2023-10-9 10:10:10",
        reward: 100,
        viewCount: 50,
        weight: 1,
        pubId: 1,
        pubName: "用户名",
        pubNickName: "测试昵称",
      }),
    },
  },

  mounted() {
  },

  methods: {},
  
};
</script>

<style scoped>
* {
  margin: 0px;
  padding: 0px;
}
.el-card {
  height: 350px;
  width: 280px;
  margin: 20px 25px;
  position: relative;
}
.title {
  overflow: hidden;
  height: 50px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  line-height: 25px;
  margin-top: 10px;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
}
.el-card /deep/ .el-card__header {
  background: linear-gradient(to right, rgb(101, 188, 223), rgb(39, 148, 190));
  color: white;
}
.header-bottom {
  /* margin-top: 10px; */
  height: 40px;
  line-height: 40px;
}
.category {
  display: inline-block;
  width: 80px;
  height: 25px;
  text-align: center;
  line-height: 25px;
  background-color: white;
  color: rgb(41, 149, 191);
  font-size: 12px;
  border-radius: 20px;
}
.user {
  float: right;
  font-size: 13px;
  margin-top: 1px;
}
.create-time {
  float: left;
}
.view-count {
  float: right;
}
.el-card .bottom {
  height: 20px;
  width: 240px;
  position: absolute;
  bottom: 10px;
}
.location .label1 {
  font-size: 16px;
  font-weight: bold;
}
.location .content {
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 40px;
  margin: 10px 0px 0px 0px;
  font-size: 14px;
  color:#606266;
  padding-left: 20px;
}
.label2 {
  font-size: 15px;
  font-weight: bold;
  margin-right: 5px;
}
.need-num {
  font-size: 14px;
  /* margin-top: 15px; */
}
.need-num div {
  display: inline-block;
}
.reward {
  /* margin-top: 15px; */
}
.info {
  height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.bottom {
  font-size: 13px;
  color: gray;
}
a {
  text-decoration: none;
  color: black;
}
/* .el-card{
  border-color: #e2e5ec;
} */
</style>